Revert "domctl: improve locking during domain destruction"
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 3 Dec 2021 10:19:16 +0000 (11:19 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 3 Dec 2021 10:19:16 +0000 (11:19 +0100)
commitd0887cc6b16e72829ac7e117bd65697463aabfe7
treecbadcffd0426caec78e22910723eac77e5034a93
parent2f531c122e957d56d214b4ba04856e6172772309
Revert "domctl: improve locking during domain destruction"

This reverts commit 228ab9992ffb1d8f9d2475f2581e68b2913acb88.

Performance analysis has shown that dropping the domctl lock during
domain destruction greatly increases the contention in the heap_lock,
thus making parallel destruction of domains slower.

The following lockperf data shows the difference between the current
code and the reverted one:

lock:  3342357(2.268295505s), block:  3263853(18.556650797s)
lock:  2788704(0.362311723s), block:   222681( 0.091152276s)

Those figures are from Dmitry Isaikin, and are gathered after
destroying 5 2GB HVM guests in parallel:

https://lists.xenproject.org/archives/html/xen-devel/2021-09/msg01515.html

Given the current point in the release, revert the commit and
reinstate holding the domctl lock during domain destruction. Further
work should be done in order to re-add more fine grained locking to
the domain destruction path once a proper solution to avoid the
heap_lock contention is found.

Reported-by: Hongyan Xia <hongyxia@amazon.com>
Reported-by: Dmitry Isaikin <isaikin-dmitry@yandex.ru>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/common/domain.c
xen/common/domctl.c